package com.softer.wxzj.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.softer.wxzj.common.entity.CommonResult;
import com.softer.wxzj.common.entity.Page;
import com.softer.wxzj.common.enums.NumberEnum;
import com.softer.wxzj.common.enums.ShiroResultEnum;
import com.softer.wxzj.entity.FlowType;
import com.softer.wxzj.entity.ZoneCode;
import com.softer.wxzj.mapper.FlowConfigMapper;
import com.softer.wxzj.mapper.FlowTypeMapper;
import com.softer.wxzj.mapper.ZoneCodeMapper;
import com.softer.wxzj.service.FlowTypeService;
import com.softer.wxzj.service.ZoneCodeService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(rollbackFor = { RuntimeException.class, Exception.class })
public class ZoneCodeServiceImpl implements ZoneCodeService {

    @Autowired
    private ZoneCodeMapper zoneCodeMapper;


    @Override
    public CommonResult insert(ZoneCode zoneCode) {
        return null;
    }

    @Override
    public CommonResult update(ZoneCode zoneCode) {
        return null;
    }

    @Override
    public CommonResult delete(String id) {
        return null;
    }

    @Override
    public PageInfo<ZoneCode> getList(Page page, ZoneCode zoneCode) {
        //只有紧跟在PageHelper.startPage方法后的第一个Mybatis的查询（Select）方法会被分页。
        PageHelper.startPage(page.getPageNum(), page.getPageSize());
        List<ZoneCode> list = zoneCodeMapper.getList(zoneCode);
        PageInfo<ZoneCode> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

}
